package module

const REMOTE_IP = "127.0.0.1"

const MAGIC_PORT = 0x3c6a << 2
const MAGIC_NUM = 0x0D3C6A20

const (
	MODULE_CORE = 0x1000 + iota
	MODULE_SYS
	MODULE_LOG
	MODULE_TEST
	MODULE_QT
	MODULE_LED
	MODULE_RTSP
	MODULE_AUDIO
	MODULE_FIFO
	MODULE_CLIENT
	MODULE_FACE
	MODULE_WEB
	MODULE_WEBSERVER
	MODULE_FTP
	MODULE_LOGGRE
	MODULE_DISCOVER
	MODULE_GO
	MODULE_ONVIF
	MODULE_MEGVII
	MODULE_WEBSOCKET
	MODULE_CONFIG
	MODULE_UPGRADE
	MODULE_REBOOT
	MODULE_CUSTOM
)

const (
	CMD_REGISTER = (MODULE_CORE << 16) + iota + 1
	CMD_UNREGISTER
	CMD_REQUEST_JSON
	CMD_REQUEST_FAILED
	CMD_RESPOND_JSON
)

const (
	CMD_MEGVII_RESPOND = (MODULE_MEGVII << 16) + iota + 1
	CMD_MEGVII_GETMODE
	CMD_MEGVII_SETMODE
	CMD_MEGVII_HELLO
	CMD_MEGVII_AXDEC_START
	CMD_MEGVII_AXDEC_STOP
	CMD_MEGVII_GET_RTSP_URL
	CMD_MEGVII_SET_RTSP_URL
)

const (
	CMD_GO_HELLO = (MODULE_GO << 16) + iota + 1
)

const (
	CMD_AUDIO_PLAYER_ADD = (MODULE_AUDIO << 16) + iota + 1
	CMD_AUDIO_PLAYER_DEL
	CMD_AUDIO_PLAYER_FIN
	CMD_AUDIO_PLAYER_SET_VOLUME
)

const (
	CMD_WEBSOCKET_JSON = (MODULE_WEBSOCKET << 16) + iota + 1
)

const (
	CMD_CONFIG_QUERY = (MODULE_CONFIG << 16) + iota + 1
	CMD_CONFIG_SET
	CMD_CONFIG_CHANGE
	CMD_CONFIG_SET_NETWORK
)

const (
	CMD_UPGRADE_WEB_UPDATE = (MODULE_UPGRADE << 16) + iota + 1
	CMD_UPGRADE_WEB_UPDATE_DONE
	CMD_UPGRADE_CLIENT_UPDATE
	CMD_UPGRADE_CLIENT_UPDATE_DONE
)

const (
	CMD_REBOOT_DO_REBOOT = (MODULE_REBOOT << 16) + iota + 1
)

type Msg_Info_St struct {
	MagicNum       uint32
	ModuleSrcId    uint16
	ModuleSrcChnId uint16
	ModuleDevId    uint16
	ModuleDevChnId uint16
	MsgType        uint32
	MsgLen         uint32
}
